package com.hit.aircraftwar.creator;


import com.hit.aircraftwar.activity.MainActivity;
import com.hit.aircraftwar.aircraft.MobEnemy;
import com.hit.aircraftwar.application.ImageManager;
import com.hit.aircraftwar.basic.AbstractFlyingObject;
import com.hit.aircraftwar.setter.ParameterSet;
import com.hit.aircraftwar.strategy.ShootStrategy;
import com.hit.aircraftwar.strategy.StraightShootStrategy;

/**
 * @author LiuYuZhe
 */
public class MobEnemyCreator implements Creator {

    /**
     * 一般敌机默认基础参数
     */
    private final int SpeedX = 0;
    private final ShootStrategy shootStrategy = new StraightShootStrategy();
    private final int direction = 1;
    private final int power = 0;
    private final int shootNum = 0;

    @Override
    public AbstractFlyingObject creatObject(int locationX, int locationY) {
        return new MobEnemy(
                locationX,
                locationY,
                this.SpeedX,
                ParameterSet.getInstance().getMobSpeedY(),
                ParameterSet.getInstance().getMobHp(),
                this.shootStrategy,
                this.direction,
                this.power,
                this.shootNum
        );
    }

    @Override
    public AbstractFlyingObject creatObject() {
        return new MobEnemy(
                (int)(Math.random() * (MainActivity.width - ImageManager.getWidth(ImageManager.MOB_ENEMY_IMAGE))),
                0,
                this.SpeedX,
                ParameterSet.getInstance().getMobSpeedY(),
                ParameterSet.getInstance().getMobHp(),
                this.shootStrategy,
                this.direction,
                this.power,
                this.shootNum
        );
    }


}
